package com.neuedu.his.controller;


import com.neuedu.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*;

@RestController
@RequestMapping("/json")
public class JsonController {


    @RequestMapping("/getString")
    String getString(){
        return new Date().toString();
    }
    @RequestMapping("getMap")
    Map getMap(){
        HashMap<Object, Object> map = new HashMap<>();
        map.put("time",new Date().getTime());
        return map;
    }


    @RequestMapping("getList")
    List getList(){
        List list = new ArrayList();


        for (int i = 0; i < 10; i++) {
            HashMap<Object, Object> map = new HashMap<>();
            map.put("time",new Date());
            list.add(map);
        }

        return list;
    }

    @RequestMapping("getUser")
    User getUser(){

        User user = new User();
        user.setId("100");
        user.setAge(100);
        user.setAddress("黑龙江省大庆市龙凤区");
        return user;
    }

}
